package com.dubbo.consumer;

import com.dubbo.service.api.FooService;
import com.dubbo.service.api.WeatherService;
import com.dubbo.service.api.mainpk.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class Consumer {
    public static void main(String[] args){
//        ApplicationContext ac = new ClassPathXmlApplicationContext("consumer.xml");
//        ((ClassPathXmlApplicationContext) ac).start();//启动消费者测试项目
//
//        System.out.print("Consumer Start......");
//        FooService Us = (FooService)ac.getBean("permissionService");
//        System.out.print("consumer"+'\n');
//        System.out.print(Us.doSomeBusinessStuff("ui"));
//        System.out.print(Us.getAllUser());

        ApplicationContext acs = new ClassPathXmlApplicationContext("consumer.xml");
        ((ClassPathXmlApplicationContext) acs).start();

        WeatherService Usc = (WeatherService)acs.getBean("noService");
        System.out.println(Usc.getAllWeather());
    }
}